<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
      }
      .main {
        width: 300px;
        height: 300px;
        background-color: aqua;
        display: grid;
        /* 设置多少列以及列的宽度 */
        grid-template-columns: 100px 100px auto;
        /* 设置多少行以及行的高度 */
        grid-template-rows: 100px 100px 1fr;
        /* 给划分好的行列分区域，然后在子项上作用即可grid-area */
        grid-template-areas:
          'a1 a1 a2'
          'a1 a1 a2'
          'a3 a3 a3';
        row-gap: 20px;
        column-gap: 30px;
        gap: 20px 10px;
      }
      .main div {
        border: 1px solid black;
        box-sizing: border-box;
      }
      .main div:nth-of-type(1) {
        grid-area: a1;
      }
      .main div:nth-of-type(2) {
        /* 定义这个元素占据哪块区域 */
        grid-area: a2;
      }
      .main div:nth-of-type(3) {
        grid-area: a3;
      }
    </style>
  </head>
  <body>
    <div class="main">
      <div>1</div>
      <div>2</div>
      <div>3</div>
      <!-- <div>4</div>
      <div>5</div>
      <div>6</div>
      <div>7</div>
      <div>8</div>
      <div>9</div> -->
    </div>
  </body>
</html>
